<?php
use yii\widgets\DetailView;
use backend\helpers\FileViewHelper;
use backend\helpers\ActionButton;


echo DetailView::widget([
    'model' => $model,
    'options' => ['class' => 'table table-striped detail-view'],
    'attributes' => [
        [
            'label' => 'Донор',
            'attribute' => 'donor.name',
        ],
        'registry_number',
        'own_number',
        'date_sign:date',
        'date_realize:date',
        'price:currency',
        'subject',
        [
            'attribute'=>'is_proxy',
            'value' => function ($model) {
                return backend\helpers\SimpleFlagHelper::statusName($model->is_proxy);
            },
            'format' => 'raw'
        ],
        [
            'attribute'=>'filename',
            'value' => FileViewHelper::simpleWithName(backend\models\ProjectDonation::BUCKET_NAME, $model->filename),
            'format' => 'raw'
        ],
    ],
]);

echo '<p>';
echo ActionButton::updateWithURI(
    'Редактировать',
    ['project-donation/update', 'id' => $model->id, 'project_id' => $model->project_id],
    'updateProject'
);
echo ActionButton::deleteWithURI(
    'Удалить',
    ['project-donation/delete', 'id' => $model->id, 'project_id' => $model->project_id],
    'Вы точно хотите удалить пожертвованиие?',
    'deleteProject'
);
echo '</p>';

echo '<br>';
echo '<br>';